package com.yyh3;

public class Circle {
    //属性
    //半径
    private double r;
    //无参构造
    public Circle() {
    }
    //有参构造
    public Circle(double r) {
        this.r = r;
    }
    //行为
    //面积方法
    public void showPerimeter(){
        double m = 0;
        m=3.14*r*r;
        System.out.println("圆的周长为"+m);
    }
    //周长方法
    public void showArea(){
        double m = 0;
        m=3.14*r*2;
        System.out.println("圆的面积为"+m);
    }
}
